题目描述:
|
|
思路:
使用队列逐层遍历,存到res,不过这道题是反向存储,所以每层得到的List就存入res的起始位置,这样就倒序了
这里有两种集合可以实现插入起始位置:
若使用ArrayList,使用add(index,ArrayList)方法
若使用LinkedList,使用addFirst(ArrayList)方法
PS:
这里遇到的一个问题就是返回值是List<List<Integer>>这样的集合嵌套形式,参见我的另一篇Java集合嵌套的笔记。
题解:
|
|
缺失模块。
1、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
2、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: true
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true